package org.yang.novel.wx.controller;

import org.yang.common.Msg;
import org.yang.novel.wx.entity.Page;
import org.yang.novel.wx.service.PageService;
import org.springframework.web.bind.annotation.*;

import com.github.pagehelper.PageInfo;

import javax.annotation.Resource;
/**
 * 章节控制器
 * @author shichenyang
 * @email gyv12345@163.com
 * @date 2019/01/07
 */
@RestController
@RequestMapping("/page")
public class PageController {
    @Resource
    private PageService pageService;

    @GetMapping("/getPages")
    public PageInfo getPages(Page page,Integer p,Integer limit){
        return pageService.getPages(page,p,limit);
    }
    @PostMapping("/addPage")
    public Msg addPage(Page page){
        return pageService.addPage(page);
    }

    @PutMapping("/updatePage")
    public Msg updatePage(Page page){
        return pageService.updatePage(page);
    }

    @DeleteMapping("/delPage")
    public Msg delPage(Page page){
        return pageService.delPage(page);
    }
}
